/**
 * 文件模型 
 * 
*/
module.exports = (sequelize, Sequelize) => {
    return sequelize.define("files", {
        id: {
            type: Sequelize.UUID,
            notNull: true,
            primaryKey: true,
            defaultValue: Sequelize.UUIDV4,
            get() { // UUID的自动递增
                return () => {
                    return this.getDataValue('id');
                };
            }
        },
        url:{
            type: Sequelize.STRING,
            comment: '文件链接',
        },
        ext:{
            type: Sequelize.STRING,
            comment: '文件后缀',
        },
        name:{
            type: Sequelize.STRING,
            comment: '文件名称',
        },
        size:{
            type: Sequelize.STRING,
            comment: '文件大小',
        },
        type: {
            type: Sequelize.INTEGER,
            comment: '文件类型',
            defaultValue: 1
        },
        status: {
            type: Sequelize.BOOLEAN,
            comment: '状态',
            defaultValue: true
        },
        content: {
            type: Sequelize.TEXT("long"),
            comment: '备注',
        },
    })
}